let fs = require("fs");

let writeStream = fs.createWriteStream("out.txt");

var data = "ni hao";

let write = writeStream.write(data, "UTF8");

console.log(write);

writeStream.end();

writeStream.on("finish", function () {
    console.log("finish............");
});


writeStream.on("error", (error) => {
    console.log(error);
});


